<style>
    .panel-header, .panel-body {
        border-width: 0px;
    }

    .datagrid, .combo-p {
        border: solid 1px #D4D4D4;
    }

    .panel-title {
        cursor: pointer
    }

    .inlineblock {
        margin-top: 10px;
    }

    .inlineblock div {
        display: inline-block;
    }

    .inlineblock div label {
        display: inline-block;
        top: 5px;
    }

    .newform {
        width: 70%;
    }

    .editform {
        width: 70%;
    }

    .searchClass {
        margin-left: 5%;
        margin-top: 1%;
    }

    .searchClass label {        width: 9%;
        font-weight: bold;
        text-align: center;
    }

    #Search {
        float: right;
        margin-right: 4%;
        width: 14%;
    }
    .ssss{
        color: #FFF;padding:5px 15px;background-color:#3F51B5;
        position:relative;top: -50px;left: 100px;
    }
    .ssss:hover{
        color: #FFF;
        text-decoration: none;
    }
</style>
<div class="row">
    <div id="breadcrumb" class="col-xs-12" style="margin-bottom: 10px">
        <a href="#" class="show-sidebar"> <i class="fa fa-bars"></i>
        </a>
        <ol class="breadcrumb pull-left">
            <li><a href="#">算力管理</a></li>
            <li><a href="#">算力管理</a></li>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <div class="box-name">
                    <i class="fa fa-clipboard"></i> <span>算力管理</span>
                </div>
                <div class="box-icons">
                    <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                    </a> <a class="expand-link"> <i class="fa fa-expand"></i>
                </a> <a class="close-link"> <i class="fa fa-times"></i>
                </a>
                </div>
                <div class="no-move"></div>
            </div>
            <div class="box-content table-responsive" style="padding-top: 15px">

                <div class="panel" style="background-color: #DFE1EB; height: auto;">
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">我的总算力</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">累计收益</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">昨日收益</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">昨日支出</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">可提现金额</h4>
                    </div>
                </div>
                <div style="border: 1px solid #CCC; height: 80px;background-color:#E8EBEF;line-height: 80px;">
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>{$data[5]} MH/s</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px;line-height: 40px;">
                        <p style="margin: 5px 0 0 0;padding: 0">¥ {$data[0]}</p>
                        <p style="margin: -15px 0 0 0;padding: 0"><img src="__WK__/style/images/ytb.png" height="20"> {$data[1]}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>
                            <span id="fuhao">
                                {if $admin['user_display']==1}
                                ¥
                                {else}
                                <img src="__WK__/style/images/ytb.png" height="20">
                                {/if}
                            </span>
                            {$data[3]}&nbsp;&nbsp;&nbsp;
                            <a href="JavaScript:;" style="color: red;" id="user_display" name="{$admin['user_display']}">更改</a>
                        </p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>-¥{$data[4]}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px;line-height: 40px;">
                        <p style="margin: 5px 0 0 0;padding: 0">¥ {$admin['user_rmb']}</p>
                        <p style="margin: -15px 0 0 0;padding: 0"><img src="__WK__/style/images/ytb.png" height="20"> {$admin['user_ytb']}</p>
                        <a href="JavaScript:;" class="ssss">提现</a>
                    </div>

                </div>

                <!--主信息面板 S-->
                <div class="panel panel-default" style="border: 1px solid #CCC;">
                    <div class="panel-heading" role="tab" id="headingTwo">
                        <h4 class="panel-title" data-toggle="collapse" data-target="#collapseForCourseTable">
                            合约管理<span class="fa fa-chevron-down" style="float: right"></span>
                        </h4>
                    </div>
                    <div id="collapseForCourseTable" class="panel-collapse collapse in" role="tabpanel"
                         aria-labelledby="headingTwo">
                        <div class="panel-body" style="overflow: hidden;">
                            <!--搜索区域-->
                            <div class="searchClass row">
                                <div class="col-xs-12">
									<label>合同编号</label>
                                    <input class="SearchForm form-control" type="text" id="con_number"/>
                                    <label>状态</label>
                                    <select class="SearchForm form-control" id="com_status" style="height:32px;">
                                        <option value="">所有</option>
                                        <option value="1">挖矿中</option>
                                        <option value="2">维护中</option>
                                        <option value="3">已停止</option>
                                        <option value="4">已到期</option>
                                    </select>
						
                                </div>
                            </div>
							<div class="searchClass row">
                                <div class="col-xs-12">
									<label>日期</label>
									<input class="SearchForm form-control" type="text" id="start" readonly/>
                                    至&nbsp;&nbsp;&nbsp;
                                    <input class="SearchForm form-control" type="text" id="end" readonly/>
                                </div>
                            </div>
                            <button id="Search" class="btn btn-primary btn-xs" style="height: 30px;margin-left: 30px">
                                <i class="fa fa-search"></i>&nbsp;&nbsp;搜索
                            </button>
                            <button id="Reset" class="btn btn-primary btn-sm" style="width:120px;float: right;">
                                清空查询条件
                            </button>
                        </div>
                        <table id="datatable_suanliinfo" data-size="15" style="width: 100%">
                        </table>
                        <div class="box-content table-responsive" style="padding-top: 15px">

                            <div class="panel" style="background-color: #DFE1EB; height: auto;">
                                <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                                    <h4 class="panel-title">总本金：¥ {$data[6]}</h4>
                                </div>
                                <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                                    <h4 class="panel-title">已回款：≈ ¥ {$data[2]}</h4>
                                </div>
                                <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                                    <h4 class="panel-title">回款比例：≈ {$data[7]}%</h4>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--主信息面板 E-->
            </div>
        </div>
    </div>
</div>
<script src="static/js/ajax/suanli.js"></script>
<script>
    $('#user_display').click(function () {
        if(confirm('确定更改收益方式吗？')){
            var display_type = $(this).attr('name');
            $.ajax({
                url: 'admin/Suanli/changeDisplay',
                type: 'POST',
                data: 'display_type='+display_type,
                dataType: 'JSON',//返回的数据类型
                success: function (data) {
                    if(data.status == 200){
                        location.reload();
                        return;
                    }else{
                        $.TeachDialog({
                            content: data.msg
                        });
                        return;
                    }

                },
                error: function () {
                    $.TeachDialog({
                        content: '系统异常，请联系管理员',
                    });
                    return;
                }
            });
        }
    });
    // TODO 为什么跳不过去，得刷新一下
    $('.ssss').click(function () {
        window.location.href = "#pay_manage";
        location.reload();
    });
</script>